package com.pig4cloud.pig.admin.controller;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pig.admin.api.entity.PasswordList;
import com.pig4cloud.pig.admin.api.entity.SysOauthClientDetails;
import com.pig4cloud.pig.admin.service.NewsListService;
import com.pig4cloud.pig.admin.service.PasswordListService;
import com.pig4cloud.pig.admin.service.SysOauthClientDetailsService;
import com.pig4cloud.pig.common.core.util.R;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@AllArgsConstructor
@RequestMapping("/passwordList")
@Tag(description = "passwordList", name = "密码管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class PasswordListController {

	private final PasswordListService passwordListService;

	private final NewsListService newsListService;

	/**
	 * 简单分页查询
	 */
	@GetMapping("/page")
	public R getPasswordListPage(@ParameterObject Page page,
									   @ParameterObject PasswordList passwordList,HttpServletRequest request) {
		return R.ok(passwordListService.getPasswordList(passwordList));
	}




	@GetMapping("/insertTest")
	public R insertTest(@ParameterObject Page page,
						@ParameterObject PasswordList passwordList) {
		return R.ok(newsListService.insertTest(passwordList));

	}


}
